var forgetPwdPage = avalon.define({
	$id: "forgetPwdPage",
	email: "",
	validate: {
		onValidateAll: function(reasons) {
			if(reasons.length) {
				mui.toast(reasons[0].getMessage());
			} else {
				var form=$("#forgetPwdForm");
				mui.ajax('/user/forgetPwd.do', {
					data: form.serialize(),
					dataType: 'json',
					type:'post',
					success: function(data) {
						 mui.alert("",data.msg);
					}
				});
			}
		}

	},
	submit: function(e) {
		e.preventDefault()
		this.validate.onManual();
	}
});


mui.ready(function() {
	if(null==$.getUrlParam("h")) {
		mui(".header").on('tap', '.login', function() {
			var url = "dahua://nativeback";
			mui.openWindow({
				url: url 
			});
		});
	}
	
	mui(".header").on('tap', '.home', function() {
		var url = this.getAttribute('href');
		mui.openWindow({
			url: url 
		});
	});
	
});
